package advance.x000.acw_92;


import java.util.*;

public class Main {

    public static List<Integer> subset;
    public static List<List<Integer>> ans;
    public static int[] nums;

    public static void main(String[] args) {
        Main solution = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        //求1——n 子集的个数
        nums=new int[n];
        subset=new ArrayList<>();
        ans=new ArrayList<>();
        for (int i = 0; i < n; i++) {
            nums[i] = i + 1;
        }
        solution.clac(0);
        for(List<Integer> list:ans){
            Collections.sort(list);
            for(Integer val:list){
                System.out.print(val+" ");
            }
            System.out.println();
        }
    }

    private void clac(int cur) {
        if (cur == nums.length) {
            ans.add(new ArrayList<>(subset));
            return;
        }
        // 两种情况
        //当前值不加
        clac(cur + 1);

        //加当前值
        subset.add(nums[cur]);
        clac(cur + 1);
        subset.remove(subset.size() - 1);
    }

}
